	ORG 0000H
	AJMP MAIN
	ORG 0100H
MAIN:
    MOV 30H,#30H
	MOV 31H,#31H
	MOV 32H,#32H
	MOV R0,#30H
	MOV R1,#20H
BCD:
    MOV A,@R0
	SWAP A
	ANL A,#0FH
	ACALL CTAB
	MOV R2,A
	MOV A,@R0
	ANL A,#0FH
	ACALL CTAB
	MOV R3,A

	MOV DPTR,#8002H
	MOV A,R1
	MOVX @DPTR,A
	MOV DPTR,#8004H
	MOV A,R2
	MOVX @DPTR,A 
	MOV A,R1
	RR A
	MOV R1,A
	ACALL DL1ms

	MOV DPTR,#8002H
	MOV A,R1
	MOVX @DPTR,A
	MOV DPTR,#8004H
	MOV A,R3
	MOVX @DPTR,A 
	MOV A,R1
	RR A
	MOV R1,A
	ACALL DL1ms

	INC R0
	CJNE R0,#33H,BCD
	LJMP MAIN

CTAB:
    PUSH DPH
	PUSH DPL
	MOV DPTR,#TAB
	MOVC A,@A+DPTR
	POP DPL
	POP DPH
	RET


DL1ms:
        MOV R6,#02H
DL:		MOV R5,#0FFH
LOOP:   DJNZ R5,LOOP
        DJNZ R6,DL
		RET
TAB:   	DB 3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH,77H,7CH,39H,5FH,79H,71H
	END